<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>

    <script src="./vue.min-2.6.11.js"></script>
    <div id="app">
        <input type="button" value="浪起来" @click='lang'>
        <input type="button" value="别浪" @click='stop'>
        <h3 v-text='msg'></h3>
    </div>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                msg: '猥琐发育，别浪~~~~~~~!',
                intervalId: null
            },
            methods: {
                lang() {
                    if (this.intervalId != null) return
                    this.intervalId = setInterval(() => {
                        const start = this.msg.substring(0, 1)
                        const end = this.msg.substring(1)
                        this.msg = end + start
                    },400)
                },
                stop(){
                    clearInterval(this.intervalId)
                    this.intervalId = null
                }
            }
        })
    </script>
</body>

</html>